import request from '@/utils/request'

export function list(params) {
  return request({
    url: `/V2/archives/${params.moduleName}/list`,
    method: 'get',
    params
  })
}

export function delModule(noticeId, row) {
  return request({
    url: `/V2/archives/${row.moduleName}/${noticeId}`,
    method: 'delete'
  })
}

// 查询现场公告详细
export function get(noticeId, _token) {
  return request({
    url: '/archives/notice/' + noticeId,
    method: 'get',
    headers: {
      _token
    }
  })
}

// 新增现场公告
export function add(data) {
  return request({
    url: '/archives/notice',
    method: 'post',
    data: data
  })
}

// 修改现场公告
export function update(data, _token) {
  return request({
    url: '/archives/notice/',
    method: 'put',
    data: data,
    headers: {
      _token
    }
  })
}

// 查询现场公告
export function getDetail(query) {
  return request({
    url: '/archives/notice/list',
    method: 'get',
    params: query
  })
}


// 身份证识别
export function discern(noticeId) {
  return request({
    url: '/archives/notice/discern',
    method: 'post'
  })
}
// 身份证识别
export function videoDiscern(data, _token) {
  return request({
    url: '/archives/notice/videoDiscern',
    method: 'post',
    data,
    headers: {
      _token
    }
  })
}
